/*
 * @Author: wwssaabb
 * @Date: 2021-09-04 16:00:33
 * @LastEditTime: 2021-09-04 16:03:42
 * @FilePath: \handwritten-code\demo\getType.js
 */

function getType(target) {
  return Object.prototype.toString.call(target).slice(8, -1)
}

console.log(getType(1)) //Number
console.log(getType(NaN)) //Number
console.log(getType('1')) //String
console.log(getType([])) //Array
console.log(getType({})) //Object
console.log(getType(false)) //Boolean
console.log(getType(Symbol('1'))) //Symbol
console.log(getType(undefined)) //Undefined
console.log(getType(null)) //Null